Add information about precision on format_percent#460
Add information about precision on format_percent#460viniciusfeitosa wants to merge 5 commits intopython-babel:masterfrom viniciusfeitosa:master
Conversation
Current coverage is 90.15% (diff: 100%)@@ master #460 diff @@
==========================================
Files 24 24
Lines 3979 3983 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 3587 3591 +4
Misses 392 392
Partials 0 0
|
babel/numbers.py
Outdated
| u'2,512%' | ||
| >>> format_percent(25.1234, locale='sv_SE') | ||
| u'2\\xa0512\\xa0%' | ||
|
|
There was a problem hiding this comment.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'
babel/numbers.py
Outdated
| u'2,512%' | ||
| >>> format_percent(25.1234, locale='sv_SE') | ||
| u'2\\xa0512\\xa0%' | ||
|
|
There was a problem hiding this comment.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'
babel/numbers.py
Outdated
| u'2,512%' | ||
| >>> format_percent(25.1234, locale='sv_SE') | ||
| u'2\\xa0512\\xa0%' | ||
|
|
There was a problem hiding this comment.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'
babel/numbers.py
Outdated
| u'2,512%' | ||
| >>> format_percent(25.1234, locale='sv_SE') | ||
| u'2\\xa0512\\xa0%' | ||
|
|
There was a problem hiding this comment.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'|
This is conflicted by #494, so closing. |
I've written more information about precision on format_percent.